<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core">
    <style>
        #mx .ui-menubutton button{
            width: 25px;
            height:18px !important
        }
    </style>

    <p:panel header="MODALIDAD" style="border: none;">
        <div align="center">
            <h:form id="datos">
                <p> <h:outputText value="REGISTRO DE MODALIDADES" style="font-weight: bold; font-size: 18px; color:#069;"/> </p>

                <h:panelGrid columns="1" >

                    
                    <h:outputText value="Nombre : " /> 
                    <p:inputText value="#{modalityBean.modality.name}" />  

                    <div align="center">
                    </div> 
                </h:panelGrid><br/>
                <p:commandButton value="Registrar"  id="ajax"  
                                 action="#{modalityBean.saveModalityComission}"  styleClass="ui-priority-primary" 
                                 icon="ui-icon ui-icon-disk" update="@form,:editar"/> 
            </h:form>


            <!--mostrando los tipos de comisiones -->
            <h:form id="editar">
                <p:dataTable  id="dataTable" var="moda" value="#{modalityBean.listModality}" widgetVar="carsTable"   
                              emptyMessage="No cars found with given criteria" filteredValue="#{modalityBean.filterListModality}"
                              paginator="true" rows="10" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                              {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                              editable="true" editMode="cell">
                    <f:facet name="header">  
                        LISTA DE LOS TIPOS DE COMISIONES
                    </f:facet>
                    <p:ajax event="cellEdit" listener="#{modalityBean.onCellEdit(moda.name)}"   />

                    <p:column headerText="NOMBRE" id="modelColumn" filterBy="name"   
                              footerText="contains"  
                              filterMatchMode="contains">
                        <p:cellEditor>  
                            <f:facet name="output"><h:outputText value="#{moda.name}" /></f:facet>  
                            <f:facet name="input"><p:inputText id="modelInput" value="#{moda.name}" style="width:96%"/></f:facet>  
                        </p:cellEditor> 
                    </p:column>
                    
                </p:dataTable>
            </h:form>
        </div>
    </p:panel>
</ui:composition>

